
#ifndef _PARSER_H
#define _PARSER_H

#include <exception>
#include "result.hpp"
#include "token.hpp"

class Parser {
public:
    class ParserException {};

    class UnexpectedEndOfTokenStreamException : public ParserException {};

    class UnexpectedTokenException : public ParserException {
        public:
            UnexpectedTokenException(const Token &t) { tok = t; }
            const Token& getToken() { return tok; }
        private:
            Token tok;
    };

    static Result* parse(const TokenStream &ts);

private:
    Parser();
};

#endif // _PARSER_H
